﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using FluentNHibernate.Mapping;

public class Class1
{
    public class Cetak
    {
        public virtual String ID { set; get; }
        public virtual File file { set; get; }
        

    }

    public class CetakMap : ClassMap<Cetak>
    {
        public CetakMap()
        {
            Id(x => x.ID);
            References(x => x.file).Cascade.All();
           
        }
    }
    public class Detail
    {
        public virtual Transaksi transaksi { get; set; }
        public virtual Cetak cetak { get; set; }
    }

    public class DetailMap : ClassMap<Detail>
    {
        public DetailMap()
        {
            References(x => x.cetak).Cascade.All();
            References(x => x.transaksi).Cascade.All();
        }
    }

    public class File
    {
        public virtual String ID { get; set; }
        public virtual DateTime Tanggal { get; set; }
        public virtual Double size { get; set; }
        public virtual String jenis { get; set; }


    }

    public class FileMap : ClassMap<File>
    {
        public FileMap()
        {
            Id(x => x.ID);
            Map(x => x.Tanggal);
            Map(x => x.size);
            Map(x => x.jenis);
        }
    }

    public class Bahan
    {
        public virtual String ID { get; set; }
        public virtual String Nama { get; set; }
        public virtual Double Harga { get; set; }
    }

    public class BahanMap : ClassMap<Bahan>
    {
        public BahanMap()
        {
            Id(x => x.ID);
            Map(x => x.Nama);
            Map(x => x.Harga);
        }
    }

    public class Member
    {
        public virtual String ID { set; get; }
        public virtual String Nama { get; set; }
        public virtual String Alamat { get; set; }
        public virtual String noHP { get; set; }
        public virtual String noTelpon { get; set; }
        public virtual String email { get; set; }
        public virtual String password { get; set; }
    }

    public class MemberMap : ClassMap<Member>
    {
        public MemberMap()
        {
            Id(x => x.ID);
            Map(x => x.Nama);
            Map(x => x.Alamat);
            Map(x => x.noHP);
            Map(x => x.noTelpon);
            Map(x => x.email);
            Map(x => x.password);
        }
    }
    public class Petugas
    {
        public virtual String ID { set; get; }
        public virtual String Nama { get; set; }
        public virtual String noHP { get; set; }
        public virtual String email { get; set; }
        public virtual String password { get; set; }

    }

    public class PetugasMap : ClassMap<Petugas>
    {
        public PetugasMap()
        {
            Id(x => x.ID);
            Map(x => x.Nama);
            Map(x => x.noHP);
            Map(x => x.email);
            Map(x => x.password);
        }
    }

    public class Produk
    {
        public virtual String ID { get; set; }
        public virtual String Nama { get; set; }
        public virtual Double Harga { get; set; }
    }

    public class ProdukMap : ClassMap<Produk>
    {
        public ProdukMap()
        {
            Id(x => x.ID);
            Map(x => x.Nama);
            Map(x => x.Harga);
        }
    }

    public class Transaksi
    {
        public virtual String ID { set; get; }
        public virtual Member member { get; set; }
        public virtual Petugas petugas { get; set; }
        
        public virtual Double totalHarga { get; set; }
        public virtual DateTime Tanggal { get; set; }


    }

    public class TransaksiMap : ClassMap<Transaksi>
    {
        public TransaksiMap()
        {
            Id(x => x.ID);
            References(x => x.member).Cascade.All();
            References(x => x.petugas).Cascade.All();
          
            Map(x => x.totalHarga);
 
            Map(x => x.Tanggal);
        }
    }

    public class Warna
    {
        public virtual String ID { get; set; }
        public virtual String Nama { get; set; }
        public virtual Double Harga { get; set; }
    }

    public class WarnaMap : ClassMap<Warna>
    {
        public WarnaMap()
        {
            Id(x => x.ID);
            Map(x => x.Nama);
            Map(x => x.Harga);
        }
    }

    public class Paket
    {
        public virtual String ID { set; get; }
        public virtual Warna warna { get; set; }
        public virtual Produk produk { get; set; }
        public virtual Bahan bahan { get; set; }
        public virtual Double panjang { get; set; }
        public virtual Double Lebar { get; set; }


    }

    public class ProdukMap : ClassMap<Warna>
    {
        public ProdukMap()
        {
            Id(x => x.ID);
            References(x => x.warna).Cascade.All();
            References(x => x.produk).Cascade.All();
            References(x => x.bahan).Cascade.All();
        
            Map(x => x.panjang);
            Map(x => x.lebar);
        }
    }
    public class PengirimanMap : ClassMap<Warna>
    {
        public PengirimanMap()
        {
            Id(x => x.ID);
            References(x => x.lokasi).Cascade.All();
            References(x => x.petugasKirim).Cascade.All();
            Map(x => x.dedline);
            Map(x => x.waktuPengiriman);
           
        }
    }

    public class Pengiriman
    {
        public virtual String ID { set; get; }
        public virtual petugas petugasKirim { set; get; }
        public virtual Date deadline{ get; set; }
        public virtual Date waktuKirim { get; set; }
        public virtual Lokasi lokasi { get; set; }
        


    }

    public class Lokasi
    {
        public virtual String ID { set; get; }
        public virtual String tempat{ get; set; }
        public virtual Double harga { get; set; }
        


    }

    public class LokasiMap : ClassMap<Warna>
    {
        public LokasiMap()
        {
            Id(x => x.ID);
                 
            Map(x => x.tempat);
            Map(x => x.harga);
           
        }
    }
}
